class CreateLogCodeHistories < ActiveRecord::Migration[5.1]
  def change
    create_table :log_code_histories do |t|
      t.string :mobile, comment: '接收手机号'
      t.integer :code_type, comment: '验证码类型'
      t.integer :code_num, comment: '验证码'
      t.integer :status, comment: '发送状态'
      t.integer :user_id, comment: '对应用户'
      t.string :ip, comment: '操作ip'

      t.timestamps
    end

    add_index :log_code_histories, :mobile
    add_index :log_code_histories, :code_type
    add_index :log_code_histories, :user_id
    add_index :log_code_histories, :status
    add_index :log_code_histories, :ip
  end
end
